package com.qixin.total.config;

import com.qixin.total.interceptor.Sessioninterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by Zhang on 2018/8/26.
 *
 */
@Configuration
public class SessionConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //配置 不需要拦截的包和请求
   String[]excludePathPatterns=new String[]{
           "/frame/**",
           "/comUser/login.html",   //登陆
           "/comUser/login",   //登陆
           "/js/**",
           "/css/**",
           "/image/**",
           "/jquery-1.8.3.min.js",
   };
        registry.addInterceptor(new Sessioninterceptor()).addPathPatterns("/**").excludePathPatterns(excludePathPatterns);
    }


}
